<%@ page import="com.portico.dept.solarch.ProjectForecast" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta name="layout" content="thin"/>
    <g:set var="entityName" value="${message(code: 'projectForecast.label', default: 'ProjectForecast')}"/>
    <title><g:message code="default.create.label" args="[entityName]"/></title>
</head>

<body>
<div class="body">
    <h1><g:message code="default.create.label" args="[entityName]"/></h1>
    <g:if test="${flash.message}">
        <div class="message">${flash.message}</div>
    </g:if>
    <g:hasErrors bean="${projectForecastInstance}">
        <div class="errors">
            <g:renderErrors bean="${projectForecastInstance}" as="list"/>
        </div>
    </g:hasErrors>
    <div id="result">
        <g:formRemote
                name="projectForecast"
                url="[controller:'projectForecast', action:'save' ]" update="result">
            <div class="dialog">
                <table>
                    <tbody>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="projectPhaseName"><g:message code="projectForecast.projectPhaseName.label"
                                                                     default="Project Phase Name"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'projectPhaseName', 'errors')}">
                            <g:textField name="projectPhaseName" value="${projectForecastInstance?.projectPhaseName}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="phaseStartDate"><g:message code="projectForecast.phaseStartDate.label"
                                                                   default="Phase Start Date"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'phaseStartDate', 'errors')}">
                            <g:datePicker name="phaseStartDate" precision="day"
                                          value="${projectForecastInstance?.phaseStartDate}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="phaseEndDate"><g:message code="projectForecast.phaseEndDate.label"
                                                                 default="Phase End Date"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'phaseEndDate', 'errors')}">
                            <g:datePicker name="phaseEndDate" precision="day"
                                          value="${projectForecastInstance?.phaseEndDate}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="estimatedEffortInDollars"><g:message
                                    code="projectForecast.estimatedEffortInDollars.label"
                                    default="Estimated Effort In Dollars"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'estimatedEffortInDollars', 'errors')}">
                            <g:textField name="estimatedEffortInDollars"
                                         value="${fieldValue(bean: projectForecastInstance, field: 'estimatedEffortInDollars')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="estimatedEffortInHours"><g:message
                                    code="projectForecast.estimatedEffortInHours.label"
                                    default="Estimated Effort In Hours"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'estimatedEffortInHours', 'errors')}">
                            <g:textField name="estimatedEffortInHours"
                                         value="${fieldValue(bean: projectForecastInstance, field: 'estimatedEffortInHours')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="forecastEffortInDollars"><g:message
                                    code="projectForecast.forecastEffortInDollars.label"
                                    default="Forecast Effort In Dollars"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'forecastEffortInDollars', 'errors')}">
                            <g:textField name="forecastEffortInDollars"
                                         value="${fieldValue(bean: projectForecastInstance, field: 'forecastEffortInDollars')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="forecastEffortInHours"><g:message
                                    code="projectForecast.forecastEffortInHours.label"
                                    default="Forecast Effort In Hours"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'forecastEffortInHours', 'errors')}">
                            <g:textField name="forecastEffortInHours"
                                         value="${fieldValue(bean: projectForecastInstance, field: 'forecastEffortInHours')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="project"><g:message code="projectForecast.project.label"
                                                            default="Project"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'project', 'errors')}">
                            <g:select name="project.id" from="${com.portico.dept.solarch.Project.list()}" optionKey="id"
                                      value="${projectForecastInstance?.project?.id}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="remainingEffortInDollars"><g:message
                                    code="projectForecast.remainingEffortInDollars.label"
                                    default="Remaining Effort In Dollars"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'remainingEffortInDollars', 'errors')}">
                            <g:textField name="remainingEffortInDollars"
                                         value="${fieldValue(bean: projectForecastInstance, field: 'remainingEffortInDollars')}"/>
                        </td>
                    </tr>

                    <tr class="prop">
                        <td valign="top" class="name">
                            <label for="remainingEffortInHours"><g:message
                                    code="projectForecast.remainingEffortInHours.label"
                                    default="Remaining Effort In Hours"/></label>
                        </td>
                        <td valign="top"
                            class="value ${hasErrors(bean: projectForecastInstance, field: 'remainingEffortInHours', 'errors')}">
                            <g:textField name="remainingEffortInHours"
                                         value="${fieldValue(bean: projectForecastInstance, field: 'remainingEffortInHours')}"/>
                        </td>
                    </tr>

                    </tbody>
                </table>
            </div>

            <div class="buttons">
                <span class="button"><g:submitButton name="create" class="save"
                                                     value="${message(code: 'default.button.create.label', default: 'Create')}"/></span>
            </div>
        </g:formRemote></div>
</div>
</body>
</html>
